<?php

namespace Inscripcion\Controller;

use Inscripcion\Controller\GenericController;
use Componentes\Controller\UtilsArrayController;

class PensumCursarController extends GenericController {
    
    
    public function __construct() {
        
    }
    
    public function getList($id = 1, $param1 = 1, $param2 = 1, $param3 = 1) {
        $id = $this->params()->fromRoute('id');
        $param1 = $this->params()->fromRoute('param1');
        // obtener el limite de registros desde la url
        switch ($id) {
            case (0):
               
                $id = $this->params()->fromRoute('param1');
                $output = $this->getPensumCursarService()->getRegistro($id);
                break;
            case (1):
                 //Retorna las materias a cursar dado una cedula
                    //http://localhost/UptaebBackend/public/inscripcion/PensumCursar/1/05247163
                $idDatoIngreso = $this->params()->fromRoute('param1');
               
                $output = $this->getPensumCursarService()->getPensumCursar($idDatoIngreso);
              
                break;
            default:
            case (2):
                 //Retorna las materias a cursar dado una cedula
                //localhost/UptaebBackEnd/public/inscripcion/PensumCursar/2/346/201521
                $idPensum = $this->params()->fromRoute('param1');
                $lapso = $this->params()->fromRoute('param2');
                $output = $this->getPensumCursarService()->getSeccionesDisponiblesSegunPensumLapso($idPensum,$lapso);
              
                break;
            default:
                return $param1;
        }
        return $this->convertirArrayAJson($output);
    }
    //put your code here
}
